# 用户管理相关页面测试
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage
import uuid
import random


class GridManager(KeyWords):
    url = KeyWords.url + 'grid-management'

    def create_grid(self):
        '''
        创建网格
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\grid_manager\create_grid.yaml')
        element_operation(self, data[0]['data'])

    def update_grid(self):
        '''
        创建网格
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\grid_manager\update_grid.yaml')
        element_operation(self, data[0]['data'])

    # 删除网格
    def delete_grid(self):
        '''
        delete
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\grid_manager\delete_grid.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    driver = choose_browser()
    L = LonginPage(driver)
    L.login('kobeAdmin002', 'kobe8888')
    case = GridManager(driver)
    case.update_grid()
